package com.eastfair.common.api;

import com.eastfair.core.base.R;
import com.eastfair.pay.dto.TransactionDTO;
import com.eastfair.pay.vo.TransactionVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "mice-pay/transaction")
public interface TransactionFeign {

    /**
     * 保存更新交易记录
     * @param transactionDTO
     * @return
     */
    @PostMapping("/save")
    R save(@RequestBody TransactionDTO transactionDTO);

    /**
     * 更新交易记录
     * @param transactionDTO
     * @return
     */
    @PostMapping("/update")
    R update(@RequestBody TransactionDTO transactionDTO);

    /**
     * @Author clm
     * @Description //通过查询条件获取交易记录
     * @Date 16:44 2023/2/20
     * @Param [transactionDTO]
     * @return com.eastfair.core.base.R<java.util.List<com.eastfair.pay.vo.TransactionVO>>
     **/
    @PostMapping("/getTransactions")
    R<List<TransactionVO>> getTransactions(@RequestBody TransactionDTO transactionDTO);
}
